package com.neusoft.neuiotms.dcom.model.hn;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.Length;

import com.neusoft.bizcore.web.jpa.model.AbstractModel;
import com.neusoft.bizcore.web.jpa.model.Comment;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
@Entity
@Table(name = "neuiot_inspection_task_asset_hn")
@org.hibernate.annotations.Table(appliesTo = "neuiot_inspection_task_asset_hn", comment = "海南日巡检任务关联资产表")
public class HnInspectionTaskAsset extends AbstractModel {

    private static final long serialVersionUID = 5189095005759011407L;

    @NotNull(message = "id不能为空")
    private Long assetId;

    @Length(max = 255, message = "固资编号不能超过{max}位")
    @Column(length = 255, nullable = false)
    @Comment("varchar(255) NOT NULL COMMENT '资产编号'")
    private String code;

    @NotBlank(message = "资产名不能为空")
    @Length(max = 255, message = "资产名不能超过{max}位")
    @Column(length = 255, nullable = false)
    @Comment("varchar(255) NOT NULL COMMENT '资产名称'")
    private String name;

    @NotBlank(message = "资产类型编码不能为空")
    @Length(max = 255, message = "资产类型编码不能超过{max}位")
    @Column(length = 255, nullable = false)
    @Comment("varchar(255) NOT NULL COMMENT '资产类型编码'")
    private String typeName;

    @NotBlank(message = "资产类型名不能为空")
    @Length(max = 255, message = "资产类型名不能超过{max}位")
    @Column(length = 255, nullable = false)
    @Comment("varchar(255) NOT NULL COMMENT '资产类型名称'")
    private String typeCode;

    @Length(max = 255, message = "规格型号不能超过{max}位")
    @Column(length = 255, nullable = true)
    @Comment("varchar(255) NULL DEFAULT NULL COMMENT '规格型号'")
    private String specification;

    /** 存放地点 */
    @Length(max = 255, message = "存放地点不能超过{max}位")
    @Column(length = 255, nullable = true)
    @Comment("varchar(255) NULL DEFAULT NULL COMMENT '存放地点'")
    private String located;

    /** 品牌 */
    @Length(max = 255, message = "品牌不能超过{max}位")
    @Column(length = 255, nullable = true)
    private String brand;

    /** 是否在线 **/
    private boolean online;

    @ManyToOne
    private HnInspectionTask task;

}
